<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Objects.aspx.cs" Inherits="Objects" Title="Data Objects" %>

<%@ Register Assembly="WebTools.UI" Namespace="WebTools.UI.WebControls" TagPrefix="webtools" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" Runat="Server">
	<h1>Data Objects</h1>
	<webtools:Alert ID="alert" runat="server" AlertType="Error" ErrorImageUrl="~/images/error.gif" SuccessImageUrl="~/images/info.gif" ValidationGroup="Product">
		<ImagePanelStyle HorizontalAlign="NotSet" />
		<ErrorStyle BackColor="LightYellow" BorderColor="Maroon" Font-Bold="True" ForeColor="Maroon"
			HorizontalAlign="NotSet" />
		<SuccessStyle HorizontalAlign="NotSet" BackColor="DarkSeaGreen" BorderColor="DarkGreen" Font-Bold="True" ForeColor="DarkGreen" />
		<HeaderStyle HorizontalAlign="NotSet" />
	</webtools:Alert>
	<p>Add a Product to the database:</p>
	<table cellpadding="4" cellspacing="2" border="0">
		<tr>
			<td valign="top">Name:</td>
			<td valign="top"><asp:TextBox ID="txtName" runat="server" MaxLength="255" Width="253px"></asp:TextBox></td>
			<td valign="top">Price:</td>
			<td valign="top"><asp:TextBox ID="txtPrice" runat="server" MaxLength="10" Width="68px"></asp:TextBox></td>
		</tr>
		<tr>
			<td valign="top">Description:</td>
			<td valign="top" colspan="3"><asp:TextBox ID="txtDescription" runat="server" TextMode="multiLine" Columns="40" Rows="8" MaxLength="4000" Width="407px"></asp:TextBox></td>
		</tr>
	</table>
	<br />
	<asp:Button ID="btnSave" runat="server" Text="Save Product" OnClick="btnSave_Click" />
	<br /><br />
	<h3>Existing Products</h3>
	<asp:GridView ID="grdProducts" runat="server" AutoGenerateColumns="False" CellPadding="2">
		<Columns>
			<asp:BoundField DataField="ID" HeaderText="ID" />
			<asp:BoundField DataField="Name" HeaderText="Name" />
			<asp:BoundField DataField="Price" DataFormatString="{0:C}" HeaderText="Price" />
			<asp:BoundField DataField="Description" HeaderText="Description" />
		</Columns>
	</asp:GridView>
	<asp:RequiredFieldValidator ID="valNameReq" runat="server" ErrorMessage="Name is required." ControlToValidate="txtName" Display="None" ValidationGroup="Product"></asp:RequiredFieldValidator>
	<asp:RequiredFieldValidator ID="valPriceReq" runat="server" ErrorMessage="Price is required." ControlToValidate="txtPrice" Display="None" ValidationGroup="Product"></asp:RequiredFieldValidator>
</asp:Content>


